1.5 Linux Command Structure
The universal syntax for Linux commands follows this format:
command [options] [arguments]
Where command is the name of the utility, options alter or tune the execution behavior of the command, and arguments target specific operational objects (such as files or directories).
Options are categorized into short options and long options. Short options begin with a single hyphen followed by a single character representing the option, for example:
$ ls -l
(note:In this examples and below, we assume the shell prompt is $. )
A single command can invoke multiple options simultaneously, separated by spaces:
$ ls -l -a
Alternatively, multiple short options can be concatenated into a single block:
$ ls -la
Long options begin with a double hyphen, typically followed by an explicit, descriptive word or hyphenated phrase, for example:
$ ls --all
Throughout the command reference sections in this book, short options are primarily utilized.
Certain Linux command options accept optional arguments, while other options strictly require them, for example:
$ tar -f file.tar
Or alternatively, using the long option syntax:
$ tar --file=file.tar